package com.nt.train.service;

import com.nt.train.dao.UseDao;
import com.nt.train.enums.Status;
/**
 * @author hlf
 * @version 1.0
 * @date 2022/8/16 13:52
 */
public class UseService {

    private UseDao  useDao;

    public void setUseDao(UseDao useDao) {
        this.useDao = useDao;
    }

    public Status checkStatus(String group) {
        int count = this.useDao.getStoreCount(group);
        if (count <= 0) {
            return Status.UNKOWN;
        }else if (count <= 800) {
            return Status.UN_SALABLE;
        }else if (count <= 1000) {
            return Status.NORMAL;
        }else{
            return Status.SELLINGWELL;
        }
    }
}
